<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>历史记录</title>
    <link rel="stylesheet" href="/static/style.css">
    <link rel="stylesheet" href="/static/history.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>
    <!-- 侧边栏 -->
    <div class="sidebar">
        <div class="sidebar-header">
            <div class="sidebar-title">
                智能工业手势识别
            </div>
           <div class="user-info">
                <span class="username">{{ current_user.username }}</span>
                <a href="{{ url_for('auth.logout_route') }}" class="logout">退出登录</a>
            </div>
        </div>
        <ul class="nav-menu">
            {% if session.role != 'admin' %}
            <li class="nav-item" onclick="window.location.href='{{ url_for('main.profile') }}'">个人信息</li>
            <li class="nav-item" onclick="window.location.href='{{ url_for('gesture.recognition') }}'">实时识别</li>
            <li class="nav-item" onclick="window.location.href='{{ url_for('gesture.gesture_config') }}'">手势配置</li>
            <li class="nav-item active">历史记录</li>
            {% else %}
            <li class="nav-item" onclick="window.location.href='{{ url_for('user.user_management') }}'">角色管理</li>
            {% endif %}
        </ul>
    </div>

    <!-- 主内容区域 -->
    <div class="main-content">
        <div class="main-container">
            <div class="history-header">
                <h1>历史记录</h1>
                <a href="{{ url_for('user.export_history_route') }}" class="export-btn">
                    <i class="fas fa-download"></i>
                    导出记录
                </a>
            </div>
            
            <div class="history-container">
                {% if records %}
                <div class="history-list">
                    {% for record in records %}
                    <div class="history-item">
                        <div class="history-time">{{ record.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</div>
                        <div class="history-gesture">手势 {{ record.gesture }}</div>
                        <div class="history-content">{{ record.content }}</div>
                    </div>
                    {% endfor %}
                </div>
                {% else %}
                <div class="no-records">暂无历史记录</div>
                {% endif %}
            </div>
        </div>
    </div>
</body>
</html> 